<form id="add-form" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择物料:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-material_id" class="form-control selectpicker" name="row[material_id]" data-live-search="true" required>
                <option value="">请选择物料</option>
                {volist name="materials" id="material"}
                <option value="{$material.id}" data-stock="{$material.stock}" data-min-stock="{$material.min_stock}" data-unit="{$material.unit}">
                    {$material.name} ({$material.code}) - 库存: {$material.stock} {$material.unit}
                </option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择供应商:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-supplier_id" class="form-control selectpicker" name="row[supplier_id]" data-live-search="true" required>
                <option value="">请选择供应商</option>
                {volist name="suppliers" id="supplier"}
                <option value="{$supplier.id}">{$supplier.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">申请数量:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-request_quantity" class="form-control" name="row[request_quantity]" type="number" step="0.01" min="0" placeholder="请输入申请数量" required>
            <span class="help-block">建议采购数量: <span id="suggested-quantity">0</span></span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">优先级:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-priority" class="form-control" name="row[priority]">
                <option value="1">低</option>
                <option value="2" selected>中</option>
                <option value="3">高</option>
                <option value="4">紧急</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">备注说明:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-notes" class="form-control" rows="3" name="row[notes]" placeholder="请输入采购备注说明"></textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">生成采购申请</button>
            <button type="reset" class="btn btn-default btn-embossed">重置</button>
        </div>
    </div>

</form>
